package biolabs.model.react

import biolabs.core.UnaryAction
import biolabs.space.Compartmentalized

class ReactionKinetics(reactions: Iterable[Reaction]) extends UnaryAction[Compartmentalized, Unit, Unit] {

	override def perform(parent: Compartmentalized, notifyProgress: Unit=>Unit) {
		for(comp <- parent.compartments) { // TODO concurrently
			val results = Reaction.react(comp.getSpeciesAmounts(), reactions)
			comp.setSpeciesAmounts(results)
		}
	}
}